def alternating_sum(n):
    if n <= 1:
        return "输入的整数必须大于1"

    total = 0
    for i in range(n):
        term = 1 / (2 * i + 1)
        if i % 2 == 0:
            total += term
        else:
            total -= term
    return total

n = int(input())
result = alternating_sum(n)*4
print(alternating_sum(n))
print(result)